﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WarriorRush.GameDynamics.SpecialAbilities
{
    public class Pierce : SpecialAbility
    {
        public Pierce()
            : base()
        {
            Targets = new List<SimplePoint> { new SimplePoint (  -1, 0 ) };
            AbilityType = AbilityTypes.Pierce;
   
        }

        public override bool Execute(CharacterClass abilityTarget, Arena arena, List<CharacterClass> additonalTargets)
        {

            var target =  arena.GetTargetedSpaces(abilityTarget.Square, Targets, true).FirstOrDefault();
            if (target != null)
                target.Character.TakeDamage(Power);
            return base.Execute(abilityTarget, arena, additonalTargets);
        }

        public override SpecialAbility GetInstance(int power)
        {
            
            return new Pierce() 
            {Power = power, ReplacesAttack = this.ReplacesAttack, ShortName = ShortName, Description = Description };
         
        }
        

    }
}
 